﻿@model FC.Data.ViewModels.Contests.ProblemContent

@{
    ViewBag.Title = $"{Model.No}. {Model.Title}({Model.Score})";
    Layout = "~/Views/Shared/_ContestsContentLayout.cshtml";
}

@section Style{
    <style>
        pre {
            border-style: none;
            margin: 0;
            padding: 0;
            background-color: transparent;
        }
    </style>
}

<h2>@Model.No. @Model.Title (@Model.Score)</h2>
<div class="row clearfix">
    <div class="col-md-10 column">
        @if (!string.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        题目描述
                    </h3>
                </div>
                <div class="panel-body">
<pre>
@Model.Description
</pre>
                    @if (!string.IsNullOrWhiteSpace(Model.Tips))
                    {
                        <div class="alert alert-dismissable alert-info" style="margin: 20px 0 0 0">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h4>
                                <strong>Tips</strong>
                            </h4>
<pre>
@Model.Tips
</pre>
                        </div>
                    }
                </div>
            </div>
        }
        @if (!string.IsNullOrWhiteSpace(Model.InputFormat))
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        输入格式
                    </h3>
                </div>
                <div class="panel-body">
<pre>
@Model.InputFormat
</pre>
                </div>
            </div>
        }
        @if (!string.IsNullOrWhiteSpace(Model.OutputFormat))
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        输出格式
                    </h3>
                </div>
                <div class="panel-body">
<pre>
@Model.OutputFormat
</pre>
                </div>
            </div>
        }
        @for (int i = 0; i < Model.Examples.Count; i++)
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        输入样例 @if (Model.Examples.Count > 1)
                        { <span>@(i + 1)</span> }
                    </h3>
                </div>
                <div class="panel-body">
<pre>
@Model.Examples[i].InputExample
</pre>
                </div>

                <div class="panel-heading" style="border-top: 1px solid rgb(221,221,221)">
                    <h3 class="panel-title">
                        输出样例 @if (Model.Examples.Count > 1)
                        { <span>@(i + 1)</span> }
                    </h3>
                </div>
                <div class="panel-body">
<pre>
@Model.Examples[i].OutputExample
</pre>
                </div>
            </div>
        }
        @if (!string.IsNullOrWhiteSpace(Model.Convention))
        {
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        数据规模约定
                    </h3>
                </div>
                <div class="panel-body">
                    @Model.Convention
                </div>
            </div>
        }
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    代码提交
                </h3>
            </div>
            <div class="panel-body">
                <a href="~/Contests/Submit/@Model.CollectionCode/@Model.No">代码提交</a>
            </div>
        </div>
    </div>

    <div class="col-md-2 column">
        <table class="table table-striped" style="border: solid 1px rgb(221,221,221); text-align:center">
            <tr><th>时间限制</th></tr>
            <tr><td>@Model.TimeLimit ms</td></tr>
            <tr><th>内存限制</th></tr>
            <tr><td>@Model.MemoryLimit kBs</td></tr>
            <tr><th>代码长度限制</th></tr>
            <tr><td>@Model.CodeLengthRestriction B</td></tr>
            <tr><th>判题程序</th></tr>
            <tr><td>@Model.TestProcedure</td></tr>
            <tr><th>作者</th></tr>
            <tr><td>@Model.Author</td></tr>
            <tr><th>原题连接</th></tr>
            <tr><td><a href="@Model.Link" target="_blank">点击前往</a></td></tr>
        </table>
    </div>
</div>
